import React, {Component} from 'react';

class App
    extends Component {
    myref=React.createRef()
    render() {
        return (
            <div>
                <h1>登录页</h1>
                {/*defaultValue默认值*/}
                <input type="text" ref={this.myref} defaultValue='哈哈哈'/>
                <br/>
                <button onClick={()=>{
                    console.log(this.myref.current.value)
                }}>登录</button>
                <button onClick={()=>{
                    this.myref.current.value=''
                }}>重置</button>
            </div>
        );
    }
}

export default App;
